﻿using CefSharp.JavascriptBinding;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace CefSharpWinformDemo
{
    public class MyCamelCaseJavascriptNameConverter : IJavascriptNameConverter
    {
        string IJavascriptNameConverter.ConvertReturnedObjectPropertyAndFieldToNameJavascript(MemberInfo memberInfo)
        {
            var name = memberInfo.Name;

            return char.ToUpperInvariant(name[0]) + name.Substring(1);
        }

        string IJavascriptNameConverter.ConvertToJavascript(MemberInfo memberInfo)
        {
            var name = memberInfo.Name;

            return char.ToUpperInvariant(name[0]) + name.Substring(1);
        }
    }
}
